package com.innovation.chengzhangriji.http;

import com.google.gson.annotations.SerializedName;
import com.innovation.library.http.InnovationRequestBody;

public class TicketGetRequest extends BaseTokenRequest {

    public static final String PATH = BaseRequest.PATH + "api/large_file_ticket";

    public static final int TYPE_IMAGE = 2;

    public static final int TYPE_AUDIO = 3;

    public static final int TYPE_VIDEO = 4;

    private int type;

    private String ext;

    private int number;

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public String getExt() {
        return ext;
    }

    public void setExt(String ext) {
        this.ext = ext;
    }

    public int getNumber() {
        return number;
    }

    public void setNumber(int number) {
        this.number = number;
    }

    @Override
    protected InnovationRequestBody getInnovationRequestBody() {
        TicketGetRequestBody body = new TicketGetRequestBody();
        body.setPhone(getPhone());
        body.setToken(getToken());
        body.setType(getType());
        body.setExt(getExt());
        body.setNumber(getNumber());
        return body;
    }

    private class TicketGetRequestBody extends BaseTokenRequestBody {

        @SerializedName("Type")
        private int type;

        @SerializedName("Ext")
        private String ext;

        @SerializedName("Size")
        private int number;

        private TicketGetRequestBody() {
            setSv(BaseRequestConfig.SV_TICKET_GET);
        }

        public int getType() {
            return type;
        }

        public void setType(int type) {
            this.type = type;
        }

        public String getExt() {
            return ext;
        }

        public void setExt(String ext) {
            this.ext = ext;
        }

        public int getNumber() {
            return number;
        }

        public void setNumber(int number) {
            this.number = number;
        }
    }
}
